//package com.plian.system.controller.fr.indicators;
//
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.entity.fr.indicators.BaseMainIndicators;
//import com.plian.system.entity.pf.AppraisalIndex;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.fr.indicators.IBaseMainIndicatorsService;
//import com.plian.system.service.fr.indicators.IComplexIndicatorsValueService;
//import com.plian.system.vo.fr.indicators.BaseMainIndicatorsVO;
//import com.plian.system.vo.report.ReportReturnVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/basemainindicators")
//@Api(value = "BaseMainIndicatorsController", tags = "主要预算指标 控制器")
//public class BaseMainIndicatorsController {
//
//    private IBaseMainIndicatorsService baseMainIndicatorsService;
//
//    private IComplexIndicatorsValueService complexIndicatorsValueService;
//
//    @PostMapping("/treeList")
//    @ApiOperation(value = "树列表(返回叶子数据) 分页", notes = "传入query")
//    public ListResult<BaseMainIndicatorsVO> treeList(@RequestBody Query query){
//        return baseMainIndicatorsService.treeList(query);
//    }
//
//    @PostMapping("/initialization")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增 初始化", notes = "传入年度")
//    public R<BaseMainIndicatorsVO> initialization(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.initialization(baseMainIndicatorsVO));
//    }
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "保存", notes = "传入baseMainIndicatorsVO")
//    public R<BaseMainIndicators> submit(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.submit(baseMainIndicatorsVO));
//    }
//
//    @PostMapping("/remove")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "删除", notes = "传入ids")
//    public R remove(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return baseMainIndicatorsService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/detail")
//    @ApiOperation(value = "详情", notes = "传入id")
//    public R<BaseMainIndicatorsVO> detail(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.detail(baseMainIndicatorsVO));
//    }
//
//    @PostMapping("/summary")
//    @ApiOperation(value = "汇总", notes = "传入id")
//    public R<BaseMainIndicatorsVO> summary(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.summary(baseMainIndicatorsVO));
//    }
//
//    @PostMapping("/details-report")
//    @ApiOperation(value = "主要财务指标预算明细表", notes = "传入年度 主表指标")
//    public R<ReportReturnVO> detailsReport(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.detailsReport(baseMainIndicatorsVO));
//    }
//
//    @GetMapping("/main-index-list")
//    @ApiOperation(value = "预算 主要指标列表 year非必填 默认当前年份")
//    public R<List<AppraisalIndex>> detailsReport(@RequestParam("year") String year){
//        return R.data(baseMainIndicatorsService.mainIndexList(year));
//    }
//
//    @PostMapping("/trend-chart")
//    @ApiOperation(value = "主要财务指标预算发展趋势图", notes = "传入年度 主表指标 单位单选")
//    public R<List<Map<String, Object>>> trendChart(@RequestBody BaseMainIndicatorsVO baseMainIndicatorsVO){
//        return R.data(baseMainIndicatorsService.trendChart(baseMainIndicatorsVO));
//    }
//
//    @GetMapping("/export/{id}")
//    @ApiOperation(value = "导出", notes = "传入id")
//    public R export(@PathVariable Long id){
//        PageData pd = new PageData();
//        pd.put("key", baseMainIndicatorsService.export(id));
//        return R.data(pd);
//    }
//
//    @GetMapping("/init-complex-indicators-value")
//    public void init(){
//        complexIndicatorsValueService.init();
//    }
//
//}
